// 导入类型、接口、模块、组件、样式
import { FC, Suspense } from "react"; // 改1

import { Spin } from "antd"; // 改2

// 路由
import routes from "./router"; // 改3
import { useRoutes } from "react-router-dom";

// 配置国际化
import { ConfigProvider } from "antd";
import zhCN from "antd/locale/zh_CN";

// 全局样式
import "@/styles/reset.less";
import "@/styles/antd.less";

interface Props {}
const Index: FC<Props> = () => {
  return (
    <Suspense
      fallback={
        <div
          style={{
            width: "100vw",
            height: "100vh",
            display: "flex",
            justifyContent: "center",
            alignItems: "center",
          }}
        >
          <Spin size="large" />
        </div>
      }
    >
      <ConfigProvider locale={zhCN}>{useRoutes(routes)}</ConfigProvider>
    </Suspense>
  );
};

export default Index;
